home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / utilities / misc / deduce121.lha / Deduce / Deduce.doc < prev    next >
Encoding:
Text File  |  1995-03-18  |  14.1 KB  |  463 lines

  1. Deduce 1.21 (bugfix)
  2. by James Williams and Eric Augustine
  3.  
  4. ***CONTENTS***
  5.  
  6.   Disclaimer.......................................................  1
  7.   What is Deduce?..................................................  1
  8.   Installation.....................................................  1
  9.   Getting Started..................................................  1
  10.   noreqtools.......................................................  2
  11.   Using Deduce.....................................................  2
  12.   Commands.........................................................  2
  13.   Load.............................................................  3
  14.   Save.............................................................  3
  15.   Why..............................................................  3
  16.   Help.............................................................  3
  17.   Quit.............................................................  3
  18.   Divulge..........................................................  4
  19.   Forget...........................................................  4
  20.   Some notes about the program.....................................  4
  21.   Examples to get you started......................................  4
  22.   To Do............................................................  4
  23.   Known Problems...................................................  5
  24.   History..........................................................  5
  25.   Contacting the Author............................................  6
  26.   Acknowledgements.................................................  6
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.                                 --- C ---
  67.  
  68. ***Disclaimer***
  69.  
  70. This program is freeware.  It is being distributed with no warranty.
  71. I can't be held responsible for any damages caused either directly or
  72. indirectly by the use of this program.  Use it at your own risk.
  73.  
  74. This program cannot be sold for profit.  If you wish to use this program
  75. in a commercial distribution, you must first obtain written permission from
  76. me.
  77.  
  78. ***What is Deduce?***
  79.  
  80. Deduce is an experiment in artificial intelligence.  It attempts to simulate
  81. deductive reasoning.  Consider the following example:
  82.  
  83. Spot is a dog.
  84. A dog is an animal.
  85. Therefore, Spot is an animal.
  86.  
  87. Deduce will accept input in the form of English sentences and upon request
  88. will answer yes/no questions about what it has been taught.
  89.  
  90. ***Installation***
  91.  
  92. As of right now, Deduce doesn't have an install script, so you will have
  93. to do the installation manually.  Just copy the ReqTools library to your
  94. libs: directory if you don't already have one there, and then drag
  95. Deduce's drawer icon to where ever you want to put it.  That's it!
  96. Hopefully I will have an install script of some kind by the next release.
  97.  
  98. ***Getting Started***
  99.  
  100. Deduce must be run from the CLI.  Open a CLI or Shell window, cd to the
  101. directory with Deduce, and type Deduce.  At this point, you should see
  102. the program name, my name, and a prompt waiting for input.
  103.  
  104. The syntax for Deduce is:
  105.  
  106. Deduce [options]
  107.  
  108. The options are:
  109.  
  110. noreqtools
  111.  
  112. For those of you who prefer to use the Workbench, I've included a script
  113. so you can run Deduce (with no options) just by double clicking on the
  114. icon.
  115.  
  116. ***noreqtools***
  117.  
  118. The noreqtools option will disable the use of the ReqTools interface in
  119. favor of the standard CLI interface.
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.                                 --- 1 ---
  133. ***Using Deduce***
  134.  
  135. Most of the time, you will probably be entering statements and asking
  136. questions.  I line of input has the form:
  137.  
  138. subject [helping verb] [verb] object
  139.  
  140. You can also make a statement negative by including the word 'no'.  For
  141. example, you could say "A dog is not a cat."  In fact, the only way
  142. you can ever get a no response to a question is by entering negative
  143. statements.
  144.  
  145. Deduce interprets any statement beginning with a "question" word to be
  146. a question.  If Deduce is unable to find a definite answer to your question,
  147. it will respond with "I don't know".  Sometimes it may seem like Deduce
  148. should know the answer to a question, but it says it doesn't know.
  149. Consider the following example:
  150.  
  151. A liquid will evaporate.
  152. A solid is not a liquid.
  153. Will a solid evaporate?
  154.  
  155. It looks like Deduce should be able to figure out that since a solid is not
  156. a liquid, it won't evaporate.  However, logically, there isn't enough
  157. information given to make that conclusion.  Deduce doesn't know anything
  158. about a solid, and so it doesn't know for sure that it can't evaporate.
  159. Perhaps another example will make this clearer.
  160.  
  161. Water will evaporate.
  162. Alcohol is not water.
  163. Will Alcohol evaporate?
  164.  
  165. This time it should be clear that simply because alcohol is not water doesn't
  166. mean it won't evaporate.
  167.  
  168. When you enter something, Deduce knows the opposite isn't necessarily true.
  169. So if you enter "A cat is not a dog", Deduce won't automatically know that
  170. a dog is not a cat.
  171.  
  172. ***Commands***
  173.  
  174. Aside from entering statements and questions, you can also tell Deduce to
  175. do something for you.  These are the commands it understands.
  176.  
  177.  Load
  178.  Save
  179.  Why
  180.  Help
  181.  Quit
  182.  Divulge
  183.  Forget
  184.  
  185. ***Load***
  186.  
  187. Load:
  188.  
  189. Load will load in a previously saved session and add it to what's currently
  190. in memory.  Load is entered on a line by itself, afterwhich you will be
  191. presented with a ReqTools interface to select a file.  If there isn't
  192. enough memory, you will have to enter the filename at a standard CLI
  193. prompt.
  194.  
  195. Note : This doesn't clear the current memory.  If you need to erase what's
  196.        already in memory, use the forget command.
  197.  
  198.                                 --- 2 ---
  199.  
  200. ***Save***
  201.  
  202. Save:
  203.  
  204. To save your work, type save, then select your save-filename using the
  205. ReqTools interface.  If you have insufficient memory, you will have to
  206. enter the filename at a CLI prompt.
  207.  
  208. Save will create a text file containing all the statements you've entered.
  209. If you want to change something you've entered, you can save your work and
  210. edit the save file with any text editor or word processor than can load
  211. and save plain ascii files.  An ampersand (&) marks the end of input, so
  212. you can put comments after it.
  213.  
  214. ***Why***
  215.  
  216. Why:
  217.  
  218. The why command is usually used to let you see the logic behind one of
  219. Deduce's responses to a question.  You must first ask the question, then
  220. enter "why" on a line by itself to see Deduce's reasoning.
  221.  
  222. You may also use the why command if you enter a statement and Deduce
  223. responds with "Yeah, I know" or "That can't be right...".  These
  224. messages mean you tried to enter something that Deduce already knows.
  225. Typing "why" at the next prompt will show you how the information is
  226. known.
  227.  
  228.  
  229. ***Help***
  230.  
  231. Help:
  232.  
  233. The help command will present you with a list of the commands available
  234. and give you a help prompt.  Entering the name of one of the commands
  235. will give you more detailed help on that command, then exit you out of
  236. the help mode.  Thanks to Eric for writing this command.
  237.  
  238. ***Quit***
  239.  
  240. Quit:
  241.  
  242. When you get tired of playing with Deduce, type "quit" to leave the program.
  243. It is synonymous with exit, bye, stop, and end.
  244.  
  245. ***Divulge***
  246.  
  247. Divulge:
  248.  
  249. Divulge will print the entire contents of Deduce's database.  This was
  250. originally put in for debugging purposes, but I decided to leave it in.
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.                                 --- 3 ---
  265. ***Forget***
  266.  
  267. Forget:
  268.  
  269. Forget makes Deduce empty its database.  This can be useful in conjunction
  270. with the load command if you want to completely replace what's in Deduce's
  271. memory.
  272.  
  273. ***Some notes about the program***
  274.  
  275. Deduce tries to interpret your sentence by looking at the position of the
  276. words.  Therefore, it is important to follow a few rules when teaching
  277. Deduce new information.  Your subject and object nouns need to be
  278. one word.  If you have to use more that one word (for an adjective or
  279. whatever) put an underscore character between the words.  This doesn't apply
  280. to articles (a, an, the) and other known words (all, every, ever, of).
  281. Deduce understands negative contractions (don't, doesn't, isn't, aren't,
  282. won't, can't, wasn't, weren't, ain't) as well as no and not.  Deduce isn't
  283. case sensitive, so don't worry about matching case on everything.  Deduce
  284. automatically strips out all punctuation from a sentence.  Words are limited
  285. to 20 characters, and sentences are limited to 20 words and 100 characters.
  286. Anything more will be stripped off.
  287.  
  288. ***Examples to get you started***
  289.  
  290. Here are some examples you can try to get you started.
  291.  
  292. Spot is a dog.
  293. A dog is an animal.
  294. A dog will eat dog_food.
  295. Chunkies is a dog_food.
  296. A cat is an animal.
  297. A dog is not a cat.
  298. Will Spot eat Chunkies?
  299. why
  300. A horse is an animal.
  301. A horse will eat hay.
  302. A horse will drink water.
  303. A horse will not eat meat.
  304. A square is a rectangle.
  305. A rectangle is a polygon.
  306. A liquid will evaporate.
  307. Water is a liquid.
  308. Alcohol is a liquid.
  309.  
  310. ***To Do***
  311.  
  312. - The parser should be able to understand more complex sentences, and be
  313.   able to answer more complex questions (besides the yes/no type).  I
  314.   have some ideas in mind, but I don't know how many of them I will be
  315.   able to implement, so I don't want to say too much just yet.
  316.  
  317. - Sooner or later I will probably have to build a GUI for this program.
  318.   I've never actually written a GUI before, so give me some time.
  319.  
  320. - Build a configuration file.
  321.  
  322. - Buy an 030 + MMU + memory expansion for my 1200 so, among other things,
  323.   I can run enforcer to check my program.  (If anyone finds that this
  324.   program causes enforcer hits, be sure to let me know)
  325.  
  326.  
  327.  
  328.  
  329.  
  330.                                 --- 4 ---
  331. ***Known Problems***
  332.  
  333. - The parse relies on the position of words to determine their part of
  334.   speech, and can therefore easily misinterpret your input.
  335.   e.g. "Green is a good color" <- good will be interpreted as a verb
  336.   (good color should have been written as good_color)
  337.  
  338. - Memory is allocated in small chunks.  This can lead to memory fragmentation
  339.   (fragmentation should be minimal unless you build a huge database)
  340.  
  341. - When asking a question, negative words are ignored, so if you entered
  342.   "Is a dog not a cat", it would be interpreted as "Is a dog a cat".
  343.  
  344. - Sometimes when you ask "why" to a question, the statements will appear in
  345.   a somewhat scrambled order.  I know what's causing this, but fixing it
  346.   would be a bit messy.  And besides, it's not THAT bad, is it?
  347.  
  348. - Since my last upload of Deduce to Aminet, I've had problems with
  349.   the ReqTools interface.  Typing load returns "load cancelled" and typing
  350.   save returns "save cancelled".  If anyone can figure out what's causing
  351.   this (perhaps a memory leak? Enforcer users?), let me know.  If you
  352.   have this problem, you can get around it with the noreqtools option: ie
  353.  
  354.   Deduce noreqtools
  355.  
  356. - Sometimes the 1st person <-> 2nd person conversion will miss words.  For
  357.   example, "I like you" becomes "you like you", and "You like me" becomes
  358.   "I like me". Also, words in the predicate half of the sentence aren't
  359.   always converted correctly.  For example, "he likes you" become "he
  360.   likes I".  I'll see if I can find an elegant solution to these.
  361.  
  362. ***History***
  363.  
  364. History:
  365.  
  366. Jan 31, 1995 : version 1.00
  367.     First release
  368.  
  369. Feb 3, 1995 :  version 1.10
  370.   * Added load and save commands
  371.   * Made an AmigaGuide version of the documentation
  372.  
  373. Mar 14, 1995 : version 1.20
  374.   * I accidently limited filenames to 20 characters on the last version.
  375.     Sorry 'bout that.
  376.   * Fixed a bug that would sometimes cause Deduce to respond "I don't know"
  377.     to a question it should know.  For example:
  378.       A horse will not eat meat.
  379.       Pork is a meat.
  380.       Will a horse eat pork?
  381.   * Added some simple online help (actually, Eric added it)
  382.   * Added a forget command to empty Deduce's database
  383.   * Fixed a bug that caused segmentation faults on a Sun Sparc Station
  384.     (This shouldn't affect the Amiga version)
  385.   * Finally broke down and bought SAS C/C++ 6.51. (That's right - I should
  386.     be able to compile that GUI code now ;) )  Since then, I've patched it
  387.     to 6.55.
  388.   * Added code to convert between first and second person.  For example:
  389.       >You are a computer
  390.       Ok.
  391.       >Are you a computer?
  392.       Yes
  393.       >why
  394.       Because:
  395.  
  396.                                 --- 5 ---
  397.        I am a computer
  398.     (thanks to Hendrik Fuss for the suggestion)
  399.   * Fixed a bug that caused Deduce problems if you typed 'why' twice in a
  400.     row
  401.   * Added a ReqTools interface for loading and saving
  402.   * Deduce now uses variable length records for storage, resulting in better
  403.     memory conservation
  404.  
  405. March 17, 1995 : version 1.21 (bugfix)
  406.   * When converting between 1st and 2nd person, Deduce would extract words
  407.     from inside other words: e.g. it would see "you" in "youth" and replace
  408.     it with "Ith" (assuming the sentence was told in second person)
  409.     (thanks to Arthur Hagen for pointing this out)
  410.   * I overlooked a special case with negative logic.  Take for example:
  411.       >I hate spam
  412.       >Vegetables are not spam
  413.       >Do I hate vegetables?
  414.       No
  415.     This has been fixed
  416.     (again, thanks to Arthur Hagen for pointing this out)
  417.   * Added a noreqtools option for the command line.
  418.  
  419. ***Contacting the Author***
  420.  
  421. If you need to contact me (for comments, questions, suggestions, bug
  422. reports, etc), my email address is :
  423.  
  424.     williamj@griffon.mwsc.edu
  425.  
  426. If you don't have email, my address is:
  427.  
  428.     James Williams
  429.     209 Thomas
  430.     Weston, MO  64098  USA
  431.  
  432. And, if you're lucky, you may even catch me on the #amiga channel on IRC
  433. with the name JamesW.
  434.  
  435. ***Acknowledgements***
  436.  
  437. I would like to thank the following people who helped make Deduce a reality:
  438.  
  439.  The authors of Mind.rexx (util/rexx/Mindrx.lha on Aminet). It was what
  440.  inspired me to write Deduce.
  441.  
  442.  Ronald Carnell, author of "Smart Alec" (Compute! Sept. 1987).  He supplied
  443.  the basic algorithm used in "Smart Alec", which I took and expanded upon
  444.  to create Deduce.
  445.  
  446.  Eric Augustine for helping me to write Deduce.  He wrote the code for
  447.  the help command and has offered to help with the GUI.
  448.  
  449.  Nico Francois for writing the fantastic ReqTools requestor library.
  450.  
  451.  Everyone who has uploaded programs to the Aminet, as well as Urban Mueller
  452.  for creating the Aminet.  Without such a large source for Amiga software,
  453.  the Amiga would most likely have faded away a long time ago.
  454.  
  455.  And everyone who owns and supports our beloved Amiga computer.  I hope to
  456.  see Amiga business pick up after this #$%?! bidding is over.  Keep up the
  457.  good work, everyone!
  458.  
  459.  
  460.  
  461.  
  462.                                 --- 6 ---
  463. ΓΏ